<div id="sorter" class="c">
  <h3>{{ _('Sort by:') }}</h3>
  <ul>
    {% for item in sort_opts %}
      {% set value, title = item[:2] %}
      {% set is_extra = True if item[2] else False %}
      <li {{ value|class_selected(selected) }}>
        <a class="{{ 'extra-opt' if is_extra else 'opt' }}"
           href="{{ url_base|urlparams(sort=value) }}">{{ title }}</a>
      </li>
    {% endfor %}
    {% if extra_sort_opts %}
      <li class="extras">
        <a href="#">{{ _('More') }}</a>
        <ul>
          {% for value, title in extra_sort_opts %}
            <li {{ value|class_selected(selected) }}>
              <a class="extra-opt" href="{{ url_base|urlparams(sort=value) }}">
                {{ title }}</a>
            </li>
          {% endfor %}
        </ul>
      </li>
    {% endif %}
  </ul>
</div>
